package com.chance.cc.crawler.development.bootstrap.yyjjb;

import com.chance.cc.crawler.core.CrawlerEnum;
import com.chance.cc.crawler.core.filter.FilterUtils;
import com.chance.cc.crawler.core.record.CrawlerRequestRecord;
import com.chance.cc.crawler.development.controller.DevCrawlerController;

/**
 * created by ljl 20210628
 * 医药经济报  大健康板块
 */
public class YyjjbHealth {

    public static void main(String[] args) {
        String domain = "yyjjbHealth";

        CrawlerRequestRecord requestRecord = CrawlerRequestRecord.builder()
                .startPageRequest(domain, CrawlerEnum.CrawlerRequestType.turnPage)
                .domain(domain)
                .httpUrl("http://www.yyjjb.com.cn/news/list/25")
                .recordKey("http://www.yyjjb.com.cn/news/list/25")
                .releaseTime(System.currentTimeMillis())
                .filter(CrawlerEnum.CrawlerRecordFilter.keyOrDateRange)
                .addFilterInfo(FilterUtils.memoryFilterKeyInfo(domain))
                .addFilterInfo(FilterUtils.dateRangeFilterInfo(24*30,null))
                .build();

        DevCrawlerController.builder()
                .triggerInfo(domain,domain,System.currentTimeMillis(),domain)
                .crawlerRequestQueue(DevCrawlerController.devRequestQueue(domain))
                .consoleResultPipeline() //控制台输出
                .fileResultPipeline("D:\\chance\\log\\tets.log",true) //文件输出
                .requestRecord(requestRecord)
                .build()
                .start();
    }
}
